package cn.binux;

import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ApolloTest {

    @Value("fastdfs.base.url:http:fastdfs.com/")
    private String fastdfsBaseUrl;

    @ApolloConfigChangeListener
    private void someChangeHandler(ConfigChangeEvent changeEvent) {

        if (changeEvent.isChanged("fastdfs.base.url")) {
            System.out.printf("我是fastdfs.base.url");
        }
    }
}
